package jiangjie2;

public class Person {
    String name;
    int age;
    public Person()
    {

    }
    public Person(String name,int age)
    {
        this.name=name;
        this.age=age;
    }
    public void eat()
    {
        System.out.println("吃饭。");
    }
    public void walk(int distance)
    {
        System.out.println("走了"+distance+"km");
        show();//不能对private的方法进行重写
        eat();
    }
    private void show()
    {
        System.out.println("我是一个人");
    }
}
